﻿using System;

namespace NDBGen
{
    public class IndentationScope : IDisposable
    {
        public IndentationScope(IIndentedTextWriter writer)
        {
            this.Writer = writer;
            this.Writer.Indentation++;
        }

        public IIndentedTextWriter Writer { get; set; }

        void IDisposable.Dispose()
        {
            this.Writer.Indentation--;
        }
    }
}